﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UserRight.ascx.cs" Inherits="NguyenHoa.Web.Controls.UserRight" %>
<%@ Register Src="FunctionDivide.ascx" TagName="FunctionDivide" TagPrefix="uc1" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v9.1, Version=9.1.4.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
  Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.v9.1" Namespace="DevExpress.Web.ASPxCallback"
  TagPrefix="dxcb" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v9.1" Namespace="DevExpress.Web.ASPxGridView"
  TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v9.1" Namespace="DevExpress.Web.ASPxEditors"
  TagPrefix="dxe" %>
<div style="width: 100%" id="divContent" runat="server">
  <div>
    <table border="0" width="100%">
      <tr>
        <td colspan="4">
          <div class="search_table" style="width: 700px">
            <div class="row" style="width: 700px; font-weight: bold; height: 20px; background: #EDFDC7">
              <div class="text_column" style="width: 200px">
                <%=GetGlobalResourceObject("Strings", "Function")%>
              </div>
              <div class="text_column" style="width: 100px; text-align: center">
                <%=GetGlobalResourceObject("Strings", "View")%>
              </div>
              <div class="text_column" style="width: 100px; text-align: center">
                <%=GetGlobalResourceObject("Strings", "Update")%>
              </div>
              <div class="text_column" style="width: 100px; text-align: center">
                <%=GetGlobalResourceObject("Strings", "Delete")%>
              </div>
              <div class="text_column" style="width: 100px; text-align: center">
                <%=GetGlobalResourceObject("Strings", "Approve")%>
              </div>
            </div>
            <asp:PlaceHolder ID="pcholdder" runat="server"></asp:PlaceHolder>
          </div>
        </td>
      </tr>
    </table>
  </div>
  <div style="padding-top: 10px;">
    <dxe:ASPxButton ID="btnSave" runat="server" Text="<%$ Resources:Strings,Save %>"
      AutoPostBack="False">
      <ClientSideEvents Click="function(s, e) {
          onBtnSaveClick(s, e);
      }" />
    </dxe:ASPxButton>
  </div>
  <dxcb:ASPxCallback ID="cbPermission" ClientInstanceName="cbPermission" runat="server"
    OnCallback="cbPermission_Callback">
    <ClientSideEvents CallbackComplete="function(s ,e){
                              cbPermission_OnCallbackComplete(s, e);
                            }" />
  </dxcb:ASPxCallback>
  <asp:HiddenField ID="hfUsername" runat="server" />
</div>

<script language="javascript" type="text/javascript">

  function onBtnSaveClick(s, e) {
    pcWaiting.Show();
    cbPermission.SendCallback('Save');
  }


  function cbPermission_OnCallbackComplete(s, e) {
    pcWaiting.Hide();
    var result = e.result.split("|");
    if (result[0] == '') {
      alertMessage('<%=(string)GetGlobalResourceObject("Messages", "ERR0005") %>');
      window.location = 'Groups.aspx';
    }
    else {
      alertMessage(result[0]);
    }
  }
</script>

